﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Summer.IO;
using System.IO;

#region License
/*
 *  Copyright (c) Dumuzi.cn 2009 , All rights reserved.
 *  CLR Version: 2.0.50727.4927
 *  NameSpace: Summer.Object
 *  Author:Edwin Tai,戴佳顺
 *  Msn:edwin19861218@hotmail.com
 *  QQ: 1961218
 *  Date:2009-11-10 21:25:43
 *  Licensed under the Microsoft Public License (Ms-PL)
 *  This license governs use of the accompanying software. 
 *  If you use the software, you accept this license.
 *  If you do not accept the license, do not use the software.
 */
#endregion

namespace Summer.Object
{
    internal static class Const
    {
        /// <summary>
        /// windir
        /// </summary>
        private const string WIN_DIR = "windir";
        /// <summary>
        /// Microsoft.NET\Framework
        /// </summary>
        private const string MS_DOTNET = @"Microsoft.NET\Framework\";
        /// <summary>
        /// The prefix of version in dotnet directory
        /// </summary>
        private const string PREFIX_VERSION = "v";
        /// <summary>
        /// The name of bin
        /// </summary>
        internal static string BIN = "bin";
        /// <summary>
        /// The path of current dotnet's version
        /// </summary>
        /// <returns></returns>
        internal static string DotNetRoot()
        {
            return Path.Combine(Environment.GetEnvironmentVariable(WIN_DIR), MS_DOTNET).ToStringJoiner() + PREFIX_VERSION + Environment.Version.Major + "." + Environment.Version.MajorRevision + "." + Environment.Version.Build;
        }
    }
}
